﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZHDJ.Core;
using ZHDJ.Data.DataCaching;
using ZHDJ.Data.Models.Common;
using ZHDJ.WebPage;

namespace ZHDJ.Web.Portal.PartySound
{
    public partial class PartySoundDetail : PortalPage
    {
        #region 页面属性
        public string ArticleID
        {
            get
            {
                return this.Request["id"] ?? "null";
            }
        }

        /// <summary>
        /// BranchID
        /// </summary>
        public string BranchID
        {
            get
            {
                return this.Request["BranchID"] ?? "null";
            }
        }

        public string Category
        {
            get { return this.Request["Category"] ?? ""; }
        }


        public string Navigation
        {
            get
            {
                string result = "党员之声";
                switch (Category)
                {
                    case "Diary": result = "民情日记"; break;
                    case "ThoughtReport": result = "思想汇报"; break;
                    default: break;
                }
                return result;
            }
        }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            PartyArticle article = DB.PartyArticles.Find(ArticleID);
            this.lblTitle.Text = article.Title;
            this.lblTime.Text = "日期：" + Convert.ToDateTime(article.CreateTime).ToString("yyyy-MM-dd");
            this.lbBranch.Text = "发布：" + SystemParameterCaching.Get(SystemParameterKey.WebArticleHostName) +
                "&nbsp;作者：" + ControlBusiness.GetMembersPickerText(article.CreateBy);
            this.ltContent.Text = article.Content;
        }
    }
}